struct wl_data_source *source)
{
GdkWaylandSeat *seat;
- GdkWaylandDisplay *display_wayland;
+ guint32 serial;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (gdk_device));
- display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
-
- wl_data_device_set_selection (seat->data_device, source,
- _gdk_wayland_display_get_serial (display_wayland));
+ serial = _gdk_wayland_seat_get_implicit_grab_serial (GDK_SEAT (seat), NULL);
+ wl_data_device_set_selection (seat->data_device, source, serial);
}
/**
GdkWaylandDisplay *wdisplay = GDK_WAYLAND_DISPLAY (gdk_clipboard_get_display (clipboard));
const char * const *mime_types;
gsize i, n_mime_types;
+ GdkSeat *seat;
+ guint32 serial;
gdk_wayland_primary_discard_offer (cb);
gdk_wayland_primary_discard_source (cb);
zwp_primary_selection_source_v1_offer (cb->source, mime_types[i]);
}
+ seat = gdk_display_get_default_seat (GDK_DISPLAY (wdisplay));
+ serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, NULL);
zwp_primary_selection_device_v1_set_selection (cb->primary_data_device,
cb->source,
- _gdk_wayland_display_get_serial (wdisplay));
+ serial);
}
return GDK_CLIPBOARD_CLASS (gdk_wayland_primary_parent_class)->claim (clipboard, formats, local, content);